﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Omu.ValueInjecter;

namespace SelfManagement.Utility.ValueCopy.Convention
{
    public class BaseTypeInjection : Omu.ValueInjecter.Injections.LoopInjection
    {
        public BaseTypeInjection()
        {
        }

        public BaseTypeInjection(string[] ignoredProps)
            : base(ignoredProps)
        {
        }

        protected override bool MatchTypes(Type source, Type target)
        {
            return source == target &&
                    (source == typeof(string)
                        || source == typeof(bool)
                        || source == typeof(decimal)
                        || source == typeof(double)
                        || source == typeof(float)
                        || source == typeof(int)
                        || source == typeof(byte)
                        || source == typeof(DateTime)
                        || source == typeof(bool?)
                        || source == typeof(int?)
                        || source == typeof(decimal?)
                        || source == typeof(double?)
                        || source == typeof(float?)
                        || source == typeof(byte?)
                        || source == typeof(DateTime?));
        }
    }
}
